package com.hd.appcommon.mapper;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.hd.appcommon.entity.Role;
import com.hd.appcommon.entity.SchoolClass;
import com.hd.appcommon.entity.TrainingPlan;
import com.hd.appcommon.entity.vo.SchoolClassVo;
import com.hd.appcommon.entity.vo.TrainingPlanCollegeVo;
import com.hd.hdxgddcommon.page.MyPage;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface TrainingPlanMapper extends BaseMapper<TrainingPlan> {

    @Select("  select r.* from training_plan r")
    List<TrainingPlan> listByTrainingPlanId();

    @Select("select tp.*,m.college_name as college" +
            " from training_plan tp ,major m " +
            "where tp.major_code=m.code ${ew.customSqlSegment}")
    IPage<TrainingPlanCollegeVo> listTrainingPlan(MyPage page, @Param("ew") LambdaQueryWrapper<TrainingPlan> queryWrapper);

}
